package com.lnsf.service.impl;

import java.util.List;

import com.lnsf.dao.impl.ShopDaoImpl;
import com.lnsf.model.Shop;
import com.lnsf.model.Users;
import com.lnsf.service.IShopService;

public class ShopServiceImpl implements IShopService {

	ShopDaoImpl shopdao = new ShopDaoImpl();
	@Override
	public List<Shop> select() {
		return shopdao.select();
	}

	@Override
	public int insert(Shop shop) {
		return shopdao.insert(shop);
	}

	@Override
	public int update(Shop shop) {
		return shopdao.update(shop);
	}

	@Override
	public int delete(Shop shop) {
		return shopdao.delete(shop);
	}

	@Override
	public Shop selectByUid(Users users) {
		List<Shop>  list = select();
		for (int i = 0; i < list.size(); i++)
		{
			if (list.get(i).getuId() == users.getuId())
			{
				return list.get(i);
			}
		}
		return null;
	}

}
